// 设置cookie
function setCookie(name, value, millisecond)
{
	var exp = new Date();
	exp.setTime(exp.getTime() + millisecond);
	document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();
}

// 获取cookie
function getCookie(name)
{
	var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
	if(arr = document.cookie.match(reg))
	{
		return unescape(arr[2]);
	}
	else
	{
		return null;
	}
}

// 删除cookie
function delCookie(name)
{
	setCookie(name, "", -1);
}